<?php

/**
 * ViewPlayers form base class.
 *
 * @method ViewPlayers getObject() Returns the current form's model object
 *
 * @package    raidpoints
 * @subpackage form
 * @author     David Driscoll
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseViewPlayersForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'altid'          => new sfWidgetFormInputText(),
      'name'           => new sfWidgetFormInputText(),
      'fullname'       => new sfWidgetFormInputText(),
      'guildedflag'    => new sfWidgetFormInputCheckbox(),
      'created_by'     => new sfWidgetFormInputText(),
      'updated_by'     => new sfWidgetFormInputText(),
      'classid'        => new sfWidgetFormInputText(),
      'genderid'       => new sfWidgetFormInputText(),
      'raceid'         => new sfWidgetFormInputText(),
      'rankid'         => new sfWidgetFormInputText(),
      'talentid'       => new sfWidgetFormInputText(),
      'talentindex'    => new sfWidgetFormInputText(),
      'talentname'     => new sfWidgetFormInputText(),
      'talentactive'   => new sfWidgetFormInputCheckbox(),
      'talentmainspec' => new sfWidgetFormInputCheckbox(),
      'talenttankspec' => new sfWidgetFormInputCheckbox(),
      'talentgroup'    => new sfWidgetFormInputText(),
      'talentspec'     => new sfWidgetFormInputText(),
      'talenturl'      => new sfWidgetFormInputText(),
      'pclass'         => new sfWidgetFormInputText(),
      'gender'         => new sfWidgetFormInputText(),
      'race'           => new sfWidgetFormInputText(),
      'rank'           => new sfWidgetFormInputText(),
      'altrank'        => new sfWidgetFormInputText(),
      'ranksort'       => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'altid'          => new sfValidatorInteger(),
      'name'           => new sfValidatorString(array('max_length' => 50)),
      'fullname'       => new sfValidatorString(array('max_length' => 50)),
      'guildedflag'    => new sfValidatorBoolean(array('required' => false)),
      'created_by'     => new sfValidatorInteger(),
      'updated_by'     => new sfValidatorInteger(),
      'classid'        => new sfValidatorInteger(),
      'genderid'       => new sfValidatorInteger(),
      'raceid'         => new sfValidatorInteger(),
      'rankid'         => new sfValidatorInteger(),
      'talentid'       => new sfValidatorInteger(array('required' => false)),
      'talentindex'    => new sfValidatorInteger(array('required' => false)),
      'talentname'     => new sfValidatorString(array('max_length' => 25, 'required' => false)),
      'talentactive'   => new sfValidatorBoolean(array('required' => false)),
      'talentmainspec' => new sfValidatorBoolean(array('required' => false)),
      'talenttankspec' => new sfValidatorBoolean(array('required' => false)),
      'talentgroup'    => new sfValidatorInteger(array('required' => false)),
      'talentspec'     => new sfValidatorString(array('max_length' => 8, 'required' => false)),
      'talenturl'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'pclass'         => new sfValidatorString(array('max_length' => 25)),
      'gender'         => new sfValidatorString(array('max_length' => 15)),
      'race'           => new sfValidatorString(array('max_length' => 50)),
      'rank'           => new sfValidatorString(array('max_length' => 15)),
      'altrank'        => new sfValidatorInteger(),
      'ranksort'       => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('view_players[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ViewPlayers';
  }

}
